Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented support for configuring a cluster metrics monitor to call cat/indices, and cat/shards. #992

Merged

Conversation

AWSHurneyt
Copy link
Collaborator

Issue #, if available:
#611

Description of changes:
Implemented support for configuring a cluster metrics monitor to call cat/indices, and cat/shards.
Documentation issue opensearch-project/documentation-website#4437

CheckList:

  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

… cat/indices, and cat/shards.

Signed-off-by: AWSHurneyt <[email protected]>
Signed-off-by: AWSHurneyt <[email protected]>
@AWSHurneyt
Copy link
Collaborator Author

The test workflows are failing in this PR because they depend on the changes in PR opensearch-project/common-utils#479. The tests pass locally after manually publishing the common-utils artifact to my local maven repo. The test outputs for the two new test classes, CatIndicesWrappersIT and CatShardsWrappersIT, are below.


./gradlew ':alerting:integTest' --tests "**CatIndicesWrappersIT"
Picked up JAVA_TOOL_OPTIONS: -Dlog4j2.formatMsgNoLookups=true
=======================================
OpenSearch Build Hamster says Hello!
  Gradle Version        : 8.1.1
  OS Info               : Mac OS X 10.16 (x86_64)
  JDK Version           : 14 (AdoptOpenJDK)
  JAVA_HOME             : /Library/Java/JavaVirtualMachines/adoptopenjdk-14.jdk/Contents/Home
  Random Testing Seed   : B8279FDE4B5F39E6
  In FIPS 140 mode      : false
=======================================

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/8.1.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD SUCCESSFUL in 9s
3 actionable tasks: 3 executed
Picked up JAVA_TOOL_OPTIONS: -Dlog4j2.formatMsgNoLookups=true
=======================================
OpenSearch Build Hamster says Hello!
  Gradle Version        : 8.1.1
  OS Info               : Mac OS X 10.16 (x86_64)
  JDK Version           : 14 (AdoptOpenJDK)
  JAVA_HOME             : /Library/Java/JavaVirtualMachines/adoptopenjdk-14.jdk/Contents/Home
  Random Testing Seed   : FF04A3303107113E
  In FIPS 140 mode      : false
=======================================

> Task :ktlint
Picked up JAVA_TOOL_OPTIONS: -Dlog4j2.formatMsgNoLookups=true

> Task :alerting-core:compileKotlin
w: /Volumes/workplace/OpenSearchAlerting/core/src/main/kotlin/org/opensearch/alerting/opensearchapi/OpenSearchExtensions.kt: (42, 27): 'convertToMap(BytesReference!, Boolean, XContentType!): Tuple<XContentType!, (Mutable)Map<String!, Any!>!>!' is deprecated. Deprecated in Java

> Task :alerting:compileKotlin
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/AlertService.kt: (218, 101): Unnecessary safe call on a non-null receiver of type AlertError. This expression will have nullable type in future releases
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/AlertService.kt: (342, 13): Unsafe use of a nullable receiver of type TotalHits?
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/AlertService.kt: (343, 17): Unsafe use of a nullable receiver of type TotalHits?
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/AlertService.kt: (344, 43): Unsafe use of a nullable receiver of type TotalHits?
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/AlertService.kt: (396, 17): Unsafe use of a nullable receiver of type TotalHits?
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/AlertService.kt: (402, 21): Unsafe use of a nullable receiver of type TotalHits?
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/AlertService.kt: (403, 43): Unsafe use of a nullable receiver of type TotalHits?
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/AlertService.kt: (433, 111): 'detailedMessage(Throwable!): String!' is deprecated. Deprecated in Java
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/AlertService.kt: (458, 17): Unsafe use of a nullable receiver of type TotalHits?
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/AlertService.kt: (515, 99): 'detailedMessage(Throwable!): String!' is deprecated. Deprecated in Java
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/BucketLevelMonitorRunner.kt: (63, 9): The corresponding parameter in the supertype 'MonitorRunner' is named 'dryRun'. This may cause problems when calling this function with named arguments.
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/DocumentLevelMonitorRunner.kt: (74, 9): The corresponding parameter in the supertype 'MonitorRunner' is named 'dryRun'. This may cause problems when calling this function with named arguments.
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/DocumentLevelMonitorRunner.kt: (110, 60): Unchecked cast: MutableMap<String, Any> to MutableMap<String, MutableMap<String, Any>>
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/DocumentLevelMonitorRunner.kt: (270, 49): 'detailedMessage(Throwable!): String!' is deprecated. Deprecated in Java
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/DocumentLevelMonitorRunner.kt: (536, 59): Unnecessary non-null assertion (!!) on a non-null receiver of type ClusterService
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/DocumentLevelMonitorRunner.kt: (698, 57): Unchecked cast: Any to MutableMap<String, Any>
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/MonitorMetadataService.kt: (174, 76): Unchecked cast: Map<String, Any> to MutableMap<String, MutableMap<String, Any>>
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/QueryLevelMonitorRunner.kt: (29, 9): The corresponding parameter in the supertype 'MonitorRunner' is named 'dryRun'. This may cause problems when calling this function with named arguments.
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/alerts/AlertIndices.kt: (225, 42): 'getter for isLocalNodeElectedMaster: Boolean' is deprecated. Deprecated in Java
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/alerts/AlertIndices.kt: (233, 42): 'getter for isLocalNodeElectedMaster: Boolean' is deprecated. Deprecated in Java
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/alerts/AlertIndices.kt: (280, 60): Unnecessary non-null assertion (!!) on a non-null receiver of type String
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/alerts/AlertIndices.kt: (282, 43): Unnecessary non-null assertion (!!) on a non-null receiver of type String
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/model/DocumentLevelTriggerRunResult.kt: (34, 51): No cast needed
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/model/MonitorMetadata.kt: (41, 51): Unchecked cast: (Mutable)Map<String!, Any!>! to MutableMap<String, String>
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/model/MonitorMetadata.kt: (51, 48): Unchecked cast: MutableMap<String, String> to MutableMap<String, Any>
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/model/MonitorMetadata.kt: (61, 86): Unchecked cast: MutableMap<String, String> to MutableMap<String, Any>
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/model/MonitorMetadata.kt: (101, 94): Unchecked cast: (Mutable)Map<String!, Any!>! to MutableMap<String, String>
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/model/WorkflowMetadata.kt: (63, 20): '@JvmOverloads' annotation has no effect for methods without default arguments
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestDeleteWorkflowAction.kt: (49, 13): Variable 'refreshPolicy' is never used
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestGetWorkflowAction.kt: (48, 13): Variable 'srcContext' is assigned but never accessed
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestGetWorkflowAction.kt: (50, 13): The value 'FetchSourceContext.DO_NOT_FETCH_SOURCE' assigned to 'var srcContext: FetchSourceContext? defined in org.opensearch.alerting.resthandler.RestGetWorkflowAction.prepareRequest' is never used
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestIndexMonitorAction.kt: (87, 69): Unchecked cast: Any? to List<String>?
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestIndexMonitorAction.kt: (92, 9): Non exhaustive 'when' statements on enum will be prohibited in 1.7, add 'CLUSTER_METRICS_MONITOR' branch or 'else' branch instead
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestIndexMonitorAction.kt: (130, 13): Condition 'monitor.dataSources != null' is always 'true'
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestIndexWorkflowAction.kt: (64, 69): Unchecked cast: Any? to List<String>?
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/service/DeleteMonitorService.kt: (118, 21): Unsafe use of a nullable receiver of type TotalHits?
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/service/DeleteMonitorService.kt: (130, 25): Variable 'response' is never used
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportDeleteWorkflowAction.kt: (172, 29): Variable 'deleteMonitorWorkflowMetadataResponse' is never used
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportDeleteWorkflowAction.kt: (322, 17): Variable 'deleteResponse' is never used
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportIndexWorkflowAction.kt: (571, 37): The expression is unused
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/DocLevelMonitorQueries.kt: (169, 38): Unchecked cast: Any to MutableMap<String, Any>
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/DocLevelMonitorQueries.kt: (176, 80): Unchecked cast: Any to MutableMap<String, Any>
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/DocLevelMonitorQueries.kt: (180, 65): Unchecked cast: Any? to MutableMap<String, Any>
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/DocLevelMonitorQueries.kt: (213, 16): Unnecessary safe call on a non-null receiver of type List<String>. This expression will have nullable type in future releases
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/DocLevelMonitorQueries.kt: (219, 29): Unchecked cast: Any? to MutableMap<String, Any>
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/DocLevelMonitorQueries.kt: (324, 37): Variable 'updateMappingResponse' initializer is redundant
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/DocLevelMonitorQueries.kt: (343, 25): Name shadowed: updateMappingRequest
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/DocLevelMonitorQueries.kt: (352, 25): Name shadowed: unwrappedException
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/DocLevelMonitorQueries.kt: (365, 21): Name shadowed: unwrappedException
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/DocLevelMonitorQueries.kt: (395, 17): Variable 'updateSettingsResponse' is never used
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatIndicesHelpers.kt: (266, 63): 'getter for zeroMemory: ByteSizeValue!' is deprecated. Deprecated in Java
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatIndicesHelpers.kt: (267, 68): 'getter for zeroMemory: ByteSizeValue!' is deprecated. Deprecated in Java
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (129, 69): Type mismatch: inferred type is KFunction1<DocsStats, Long> but (DocsStats?) -> Any was expected
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (130, 71): Type mismatch: inferred type is KFunction1<StoreStats, ByteSizeValue!> but (StoreStats?) -> Any was expected
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (133, 85): Type mismatch: inferred type is KFunction1<CompletionStats, ByteSizeValue!> but (CompletionStats?) -> Any was expected
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (134, 85): Type mismatch: inferred type is KFunction1<FieldDataStats, ByteSizeValue!> but (FieldDataStats?) -> Any was expected
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (135, 88): Type mismatch: inferred type is KFunction1<FieldDataStats, Long> but (FieldDataStats?) -> Any was expected
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (136, 76): Type mismatch: inferred type is KFunction1<FlushStats, Long> but (FlushStats?) -> Any was expected
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (137, 80): Type mismatch: inferred type is KFunction1<FlushStats, TimeValue!> but (FlushStats?) -> Any was expected
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (138, 74): Type mismatch: inferred type is KFunction1<GetStats, Long> but (GetStats?) -> Any was expected
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (139, 71): Type mismatch: inferred type is KFunction1<GetStats, TimeValue!> but (GetStats?) -> Any was expected
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (140, 72): Type mismatch: inferred type is KFunction1<GetStats, Long> but (GetStats?) -> Any was expected
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (141, 77): Type mismatch: inferred type is KFunction1<GetStats, TimeValue!> but (GetStats?) -> Any was expected
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (142, 78): Type mismatch: inferred type is KFunction1<GetStats, Long> but (GetStats?) -> Any was expected
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (143, 78): Type mismatch: inferred type is KFunction1<GetStats, TimeValue!> but (GetStats?) -> Any was expected
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (144, 79): Type mismatch: inferred type is KFunction1<GetStats, Long> but (GetStats?) -> Any was expected
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (145, 92): Unsafe use of a nullable receiver of type IndexingStats?
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (146, 89): Unsafe use of a nullable receiver of type IndexingStats?
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (147, 90): Unsafe use of a nullable receiver of type IndexingStats?
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (148, 91): Unsafe use of a nullable receiver of type IndexingStats?
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (149, 88): Unsafe use of a nullable receiver of type IndexingStats?
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (150, 89): Unsafe use of a nullable receiver of type IndexingStats?
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (151, 90): Unsafe use of a nullable receiver of type IndexingStats?
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (152, 79): Type mismatch: inferred type is KFunction1<MergeStats, Long> but (MergeStats?) -> Any was expected
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (153, 83): Type mismatch: inferred type is KFunction1<MergeStats, Long> but (MergeStats?) -> Any was expected
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (154, 83): Type mismatch: inferred type is KFunction1<MergeStats, ByteSizeValue!> but (MergeStats?) -> Any was expected
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (155, 77): Type mismatch: inferred type is KFunction1<MergeStats, Long> but (MergeStats?) -> Any was expected
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (156, 81): Type mismatch: inferred type is KFunction1<MergeStats, Long> but (MergeStats?) -> Any was expected
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (157, 81): Type mismatch: inferred type is KFunction1<MergeStats, ByteSizeValue!> but (MergeStats?) -> Any was expected
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (158, 81): Type mismatch: inferred type is KFunction1<MergeStats, TimeValue!> but (MergeStats?) -> Any was expected
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (159, 87): Type mismatch: inferred type is KFunction1<QueryCacheStats, ByteSizeValue!> but (QueryCacheStats?) -> Any was expected
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (160, 90): Type mismatch: inferred type is KFunction1<QueryCacheStats, Long> but (QueryCacheStats?) -> Any was expected
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (162, 80): Type mismatch: inferred type is KFunction1<RefreshStats, Long> but (RefreshStats?) -> Any was expected
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (163, 79): Type mismatch: inferred type is KFunction1<RefreshStats, TimeValue!> but (RefreshStats?) -> Any was expected
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (164, 87): Unsafe use of a nullable receiver of type SearchStats?
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (165, 84): Unsafe use of a nullable receiver of type SearchStats?
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (166, 85): Unsafe use of a nullable receiver of type SearchStats?
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (167, 85): Type mismatch: inferred type is KFunction1<SearchStats, Long> but (SearchStats?) -> Any was expected
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (168, 87): Unsafe use of a nullable receiver of type SearchStats?
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (169, 84): Unsafe use of a nullable receiver of type SearchStats?
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (170, 85): Unsafe use of a nullable receiver of type SearchStats?
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (171, 88): Unsafe use of a nullable receiver of type SearchStats?
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (172, 85): Unsafe use of a nullable receiver of type SearchStats?
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (173, 86): Unsafe use of a nullable receiver of type SearchStats?
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (174, 82): Type mismatch: inferred type is KFunction1<SegmentsStats, Long> but (SegmentsStats?) -> Any was expected
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (175, 83): Type mismatch: inferred type is KFunction1<SegmentsStats, ByteSizeValue!> but (SegmentsStats?) -> Any was expected
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (175, 98): 'getZeroMemory(): ByteSizeValue!' is deprecated. Deprecated in Java
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (176, 94): Type mismatch: inferred type is KFunction1<SegmentsStats, ByteSizeValue!> but (SegmentsStats?) -> Any was expected
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (177, 93): Type mismatch: inferred type is KFunction1<SegmentsStats, ByteSizeValue!> but (SegmentsStats?) -> Any was expected
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (178, 86): Type mismatch: inferred type is KFunction1<SegmentsStats, ByteSizeValue!> but (SegmentsStats?) -> Any was expected
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (179, 85): Type mismatch: inferred type is KFunction1<SeqNoStats, Long> but (SeqNoStats?) -> Any was expected
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (180, 84): Type mismatch: inferred type is KFunction1<SeqNoStats, Long> but (SeqNoStats?) -> Any was expected
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (181, 77): Type mismatch: inferred type is KFunction1<SeqNoStats, Long> but (SeqNoStats?) -> Any was expected
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (210, 59): Unsafe use of a nullable receiver of type UnassignedInfo?
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (212, 40): Unsafe use of a nullable receiver of type UnassignedInfo?
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (214, 92): Unsafe use of a nullable receiver of type UnassignedInfo?
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (215, 41): Unsafe use of a nullable receiver of type UnassignedInfo?
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (221, 42): Unsafe use of a nullable receiver of type RecoverySource?
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/destinationmigration/DestinationMigrationCoordinator.kt: (77, 45): 'getter for isLocalNodeElectedMaster: Boolean' is deprecated. Deprecated in Java
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/workflow/CompositeWorkflowRunner.kt: (145, 17): Condition 'delegateRunResult != null' is always 'true'

> Task :alerting:compileJava
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

> Task :alerting:compileTestKotlin
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/AlertingRestTestCase.kt: (573, 52): Unchecked cast: Any? to Map<String, Any>
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/AlertingRestTestCase.kt: (590, 53): Unchecked cast: Any? to Map<String, Any>
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/DocumentMonitorRunnerIT.kt: (188, 13): Variable 'testDoc' is never used
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/DocumentMonitorRunnerIT.kt: (523, 13): Variable 'searchResult' is never used
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/DocumentMonitorRunnerIT.kt: (562, 13): Variable 'searchResult' is never used
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/DocumentMonitorRunnerIT.kt: (615, 13): Variable 'searchResult' is never used
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/DocumentMonitorRunnerIT.kt: (676, 13): Variable 'searchResult' is never used
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/DocumentMonitorRunnerIT.kt: (697, 13): Variable 'testDoc' is never used
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/MonitorDataSourcesIT.kt: (72, 8): This class shouldn't be used in Kotlin. Use kotlin.collections.Map or kotlin.collections.MutableMap instead.
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/MonitorDataSourcesIT.kt: (340, 9): The value 'executeMonitor(monitor, id, false)' assigned to 'var executeMonitorResponse: ExecuteMonitorResponse? defined in org.opensearch.alerting.MonitorDataSourcesIT.`test execute monitor without triggers`' is never used
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/MonitorDataSourcesIT.kt: (407, 13): Variable 'mappingsResp' is never used
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/MonitorDataSourcesIT.kt: (996, 38): Variable 'executeMonitorResponse' initializer is redundant
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/MonitorDataSourcesIT.kt: (1085, 13): Variable 'clusterStateResponse' is never used
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/MonitorDataSourcesIT.kt: (1413, 13): Condition 'updateMonitorResponse != null' is always 'true'
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/MonitorDataSourcesIT.kt: (1414, 13): The value 'executeMonitor(updateMonitorResponse.monitor, monitorId, false)' assigned to 'var executeMonitorResponse: ExecuteMonitorResponse? defined in org.opensearch.alerting.MonitorDataSourcesIT.`test execute pre-existing monitor and update`' is never used
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/MonitorDataSourcesIT.kt: (1953, 27): Condition 'alerts != null' is always 'true'
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/MonitorDataSourcesIT.kt: (1971, 27): Condition 'alerts != null' is always 'true'
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/MonitorDataSourcesIT.kt: (1979, 27): Condition 'alerts != null' is always 'true'
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/MonitorDataSourcesIT.kt: (2072, 27): Condition 'alerts != null' is always 'true'
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/MonitorDataSourcesIT.kt: (2088, 27): Condition 'alerts != null' is always 'true'
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/MonitorDataSourcesIT.kt: (2096, 27): Condition 'alerts != null' is always 'true'
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/MonitorDataSourcesIT.kt: (2140, 36): Unnecessary safe call on a non-null receiver of type IndexMonitorResponse?. This expression will have nullable type in future releases
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/MonitorDataSourcesIT.kt: (2178, 9): The value 'monitorResponse!!.monitor' assigned to 'var monitor: Monitor defined in org.opensearch.alerting.MonitorDataSourcesIT.`test queryIndex gets increased max fields in mappings`' is never used
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/MonitorDataSourcesIT.kt: (2223, 31): Condition 'alerts != null' is always 'true'
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/ODFERestTestCase.kt: (115, 18): 'OPENSEARCH_SECURITY_SSL_HTTP_KEYSTORE_PASSWORD: String' is deprecated. Deprecated in Java
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/ODFERestTestCase.kt: (116, 18): 'OPENSEARCH_SECURITY_SSL_HTTP_KEYSTORE_KEYPASSWORD: String' is deprecated. Deprecated in Java
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/aggregation/bucketselectorext/BucketSelectorExtAggregatorTests.kt: (105, 17): 'assertThat(T!, Matcher<in T!>!): Unit' is deprecated. Deprecated in Java
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/aggregation/bucketselectorext/BucketSelectorExtAggregatorTests.kt: (165, 17): 'assertThat(T!, Matcher<in T!>!): Unit' is deprecated. Deprecated in Java
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/aggregation/bucketselectorext/BucketSelectorExtAggregatorTests.kt: (186, 17): 'assertThat(T!, Matcher<in T!>!): Unit' is deprecated. Deprecated in Java
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/aggregation/bucketselectorext/BucketSelectorExtAggregatorTests.kt: (229, 17): 'assertThat(T!, Matcher<in T!>!): Unit' is deprecated. Deprecated in Java
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/aggregation/bucketselectorext/BucketSelectorExtAggregatorTests.kt: (273, 17): 'assertThat(T!, Matcher<in T!>!): Unit' is deprecated. Deprecated in Java
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/aggregation/bucketselectorext/BucketSelectorExtAggregatorTests.kt: (321, 17): 'assertThat(T!, Matcher<in T!>!): Unit' is deprecated. Deprecated in Java
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/resthandler/MonitorRestApiIT.kt: (833, 13): Variable 'alert' is never used
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/resthandler/MonitorRestApiIT.kt: (916, 17): Name shadowed: alerts
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/resthandler/SecureWorkflowRestApiIT.kt: (1101, 75): Unnecessary safe call on a non-null receiver of type Response. This expression will have nullable type in future releases
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/resthandler/SecureWorkflowRestApiIT.kt: (1204, 89): Unnecessary safe call on a non-null receiver of type Response. This expression will have nullable type in future releases
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/resthandler/SecureWorkflowRestApiIT.kt: (1400, 73): Unnecessary non-null assertion (!!) on a non-null receiver of type Monitor
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/transport/AlertingSingleNodeTestCase.kt: (91, 9): The expression is unused
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/transport/AlertingSingleNodeTestCase.kt: (196, 13): Variable 'foundAlias' is never used
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/transport/AlertingSingleNodeTestCase.kt: (207, 13): Variable 'foundAlias' is never used
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatIndicesWrappersIT.kt: (39, 9): 'assertEquals(Array<(out) Any!>!, Array<(out) Any!>!): Unit' is deprecated. Deprecated in Java
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatIndicesWrappersIT.kt: (40, 9): 'assertEquals(Array<(out) Any!>!, Array<(out) Any!>!): Unit' is deprecated. Deprecated in Java
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatIndicesWrappersIT.kt: (53, 9): 'assertEquals(Array<(out) Any!>!, Array<(out) Any!>!): Unit' is deprecated. Deprecated in Java
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatIndicesWrappersIT.kt: (54, 9): 'assertEquals(Array<(out) Any!>!, Array<(out) Any!>!): Unit' is deprecated. Deprecated in Java
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatIndicesWrappersIT.kt: (67, 9): 'assertEquals(Array<(out) Any!>!, Array<(out) Any!>!): Unit' is deprecated. Deprecated in Java
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatIndicesWrappersIT.kt: (68, 9): 'assertEquals(Array<(out) Any!>!, Array<(out) Any!>!): Unit' is deprecated. Deprecated in Java
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatIndicesWrappersIT.kt: (109, 49): Unchecked cast: Any? to List<kotlin.collections.HashMap<String, String> /* = java.util.HashMap<String, String> */>
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatIndicesWrappersIT.kt: (152, 49): Unchecked cast: Any? to List<kotlin.collections.HashMap<String, String> /* = java.util.HashMap<String, String> */>
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsWrappersIT.kt: (36, 9): 'assertEquals(Array<(out) Any!>!, Array<(out) Any!>!): Unit' is deprecated. Deprecated in Java
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsWrappersIT.kt: (48, 9): 'assertEquals(Array<(out) Any!>!, Array<(out) Any!>!): Unit' is deprecated. Deprecated in Java
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsWrappersIT.kt: (60, 9): 'assertEquals(Array<(out) Any!>!, Array<(out) Any!>!): Unit' is deprecated. Deprecated in Java
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsWrappersIT.kt: (101, 49): Unchecked cast: Any? to List<kotlin.collections.HashMap<String, String> /* = java.util.HashMap<String, String> */>
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsWrappersIT.kt: (144, 49): Unchecked cast: Any? to List<kotlin.collections.HashMap<String, String> /* = java.util.HashMap<String, String> */>

> Task :alerting:integTest
Picked up JAVA_TOOL_OPTIONS: -Dlog4j2.formatMsgNoLookups=true

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/8.1.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD SUCCESSFUL in 2m 15s
16 actionable tasks: 16 executed

./gradlew ':alerting:integTest' --tests "**CatShardsWrappersIT"
Picked up JAVA_TOOL_OPTIONS: -Dlog4j2.formatMsgNoLookups=true
=======================================
OpenSearch Build Hamster says Hello!
  Gradle Version        : 8.1.1
  OS Info               : Mac OS X 10.16 (x86_64)
  JDK Version           : 14 (AdoptOpenJDK)
  JAVA_HOME             : /Library/Java/JavaVirtualMachines/adoptopenjdk-14.jdk/Contents/Home
  Random Testing Seed   : E74DBD562D37570F
  In FIPS 140 mode      : false
=======================================

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/8.1.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD SUCCESSFUL in 2s
3 actionable tasks: 3 executed
Picked up JAVA_TOOL_OPTIONS: -Dlog4j2.formatMsgNoLookups=true
=======================================
OpenSearch Build Hamster says Hello!
  Gradle Version        : 8.1.1
  OS Info               : Mac OS X 10.16 (x86_64)
  JDK Version           : 14 (AdoptOpenJDK)
  JAVA_HOME             : /Library/Java/JavaVirtualMachines/adoptopenjdk-14.jdk/Contents/Home
  Random Testing Seed   : 5BB00FB1D68F22FD
  In FIPS 140 mode      : false
=======================================

> Task :ktlint
Picked up JAVA_TOOL_OPTIONS: -Dlog4j2.formatMsgNoLookups=true

> Task :alerting-core:compileKotlin
w: /Volumes/workplace/OpenSearchAlerting/core/src/main/kotlin/org/opensearch/alerting/opensearchapi/OpenSearchExtensions.kt: (42, 27): 'convertToMap(BytesReference!, Boolean, XContentType!): Tuple<XContentType!, (Mutable)Map<String!, Any!>!>!' is deprecated. Deprecated in Java

> Task :alerting:compileKotlin
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/AlertService.kt: (218, 101): Unnecessary safe call on a non-null receiver of type AlertError. This expression will have nullable type in future releases
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/AlertService.kt: (342, 13): Unsafe use of a nullable receiver of type TotalHits?
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/AlertService.kt: (343, 17): Unsafe use of a nullable receiver of type TotalHits?
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/AlertService.kt: (344, 43): Unsafe use of a nullable receiver of type TotalHits?
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/AlertService.kt: (396, 17): Unsafe use of a nullable receiver of type TotalHits?
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/AlertService.kt: (402, 21): Unsafe use of a nullable receiver of type TotalHits?
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/AlertService.kt: (403, 43): Unsafe use of a nullable receiver of type TotalHits?
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/AlertService.kt: (433, 111): 'detailedMessage(Throwable!): String!' is deprecated. Deprecated in Java
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/AlertService.kt: (458, 17): Unsafe use of a nullable receiver of type TotalHits?
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/AlertService.kt: (515, 99): 'detailedMessage(Throwable!): String!' is deprecated. Deprecated in Java
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/BucketLevelMonitorRunner.kt: (63, 9): The corresponding parameter in the supertype 'MonitorRunner' is named 'dryRun'. This may cause problems when calling this function with named arguments.
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/DocumentLevelMonitorRunner.kt: (74, 9): The corresponding parameter in the supertype 'MonitorRunner' is named 'dryRun'. This may cause problems when calling this function with named arguments.
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/DocumentLevelMonitorRunner.kt: (110, 60): Unchecked cast: MutableMap<String, Any> to MutableMap<String, MutableMap<String, Any>>
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/DocumentLevelMonitorRunner.kt: (270, 49): 'detailedMessage(Throwable!): String!' is deprecated. Deprecated in Java
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/DocumentLevelMonitorRunner.kt: (536, 59): Unnecessary non-null assertion (!!) on a non-null receiver of type ClusterService
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/DocumentLevelMonitorRunner.kt: (698, 57): Unchecked cast: Any to MutableMap<String, Any>
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/MonitorMetadataService.kt: (174, 76): Unchecked cast: Map<String, Any> to MutableMap<String, MutableMap<String, Any>>
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/QueryLevelMonitorRunner.kt: (29, 9): The corresponding parameter in the supertype 'MonitorRunner' is named 'dryRun'. This may cause problems when calling this function with named arguments.
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/alerts/AlertIndices.kt: (225, 42): 'getter for isLocalNodeElectedMaster: Boolean' is deprecated. Deprecated in Java
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/alerts/AlertIndices.kt: (233, 42): 'getter for isLocalNodeElectedMaster: Boolean' is deprecated. Deprecated in Java
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/alerts/AlertIndices.kt: (280, 60): Unnecessary non-null assertion (!!) on a non-null receiver of type String
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/alerts/AlertIndices.kt: (282, 43): Unnecessary non-null assertion (!!) on a non-null receiver of type String
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/model/DocumentLevelTriggerRunResult.kt: (34, 51): No cast needed
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/model/MonitorMetadata.kt: (41, 51): Unchecked cast: (Mutable)Map<String!, Any!>! to MutableMap<String, String>
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/model/MonitorMetadata.kt: (51, 48): Unchecked cast: MutableMap<String, String> to MutableMap<String, Any>
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/model/MonitorMetadata.kt: (61, 86): Unchecked cast: MutableMap<String, String> to MutableMap<String, Any>
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/model/MonitorMetadata.kt: (101, 94): Unchecked cast: (Mutable)Map<String!, Any!>! to MutableMap<String, String>
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/model/WorkflowMetadata.kt: (63, 20): '@JvmOverloads' annotation has no effect for methods without default arguments
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestDeleteWorkflowAction.kt: (49, 13): Variable 'refreshPolicy' is never used
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestGetWorkflowAction.kt: (48, 13): Variable 'srcContext' is assigned but never accessed
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestGetWorkflowAction.kt: (50, 13): The value 'FetchSourceContext.DO_NOT_FETCH_SOURCE' assigned to 'var srcContext: FetchSourceContext? defined in org.opensearch.alerting.resthandler.RestGetWorkflowAction.prepareRequest' is never used
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestIndexMonitorAction.kt: (87, 69): Unchecked cast: Any? to List<String>?
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestIndexMonitorAction.kt: (92, 9): Non exhaustive 'when' statements on enum will be prohibited in 1.7, add 'CLUSTER_METRICS_MONITOR' branch or 'else' branch instead
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestIndexMonitorAction.kt: (130, 13): Condition 'monitor.dataSources != null' is always 'true'
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestIndexWorkflowAction.kt: (64, 69): Unchecked cast: Any? to List<String>?
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/service/DeleteMonitorService.kt: (118, 21): Unsafe use of a nullable receiver of type TotalHits?
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/service/DeleteMonitorService.kt: (130, 25): Variable 'response' is never used
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportDeleteWorkflowAction.kt: (172, 29): Variable 'deleteMonitorWorkflowMetadataResponse' is never used
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportDeleteWorkflowAction.kt: (322, 17): Variable 'deleteResponse' is never used
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportIndexWorkflowAction.kt: (571, 37): The expression is unused
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/DocLevelMonitorQueries.kt: (169, 38): Unchecked cast: Any to MutableMap<String, Any>
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/DocLevelMonitorQueries.kt: (176, 80): Unchecked cast: Any to MutableMap<String, Any>
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/DocLevelMonitorQueries.kt: (180, 65): Unchecked cast: Any? to MutableMap<String, Any>
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/DocLevelMonitorQueries.kt: (213, 16): Unnecessary safe call on a non-null receiver of type List<String>. This expression will have nullable type in future releases
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/DocLevelMonitorQueries.kt: (219, 29): Unchecked cast: Any? to MutableMap<String, Any>
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/DocLevelMonitorQueries.kt: (324, 37): Variable 'updateMappingResponse' initializer is redundant
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/DocLevelMonitorQueries.kt: (343, 25): Name shadowed: updateMappingRequest
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/DocLevelMonitorQueries.kt: (352, 25): Name shadowed: unwrappedException
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/DocLevelMonitorQueries.kt: (365, 21): Name shadowed: unwrappedException
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/DocLevelMonitorQueries.kt: (395, 17): Variable 'updateSettingsResponse' is never used
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatIndicesHelpers.kt: (266, 63): 'getter for zeroMemory: ByteSizeValue!' is deprecated. Deprecated in Java
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatIndicesHelpers.kt: (267, 68): 'getter for zeroMemory: ByteSizeValue!' is deprecated. Deprecated in Java
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (129, 69): Type mismatch: inferred type is KFunction1<DocsStats, Long> but (DocsStats?) -> Any was expected
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (130, 71): Type mismatch: inferred type is KFunction1<StoreStats, ByteSizeValue!> but (StoreStats?) -> Any was expected
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (133, 85): Type mismatch: inferred type is KFunction1<CompletionStats, ByteSizeValue!> but (CompletionStats?) -> Any was expected
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (134, 85): Type mismatch: inferred type is KFunction1<FieldDataStats, ByteSizeValue!> but (FieldDataStats?) -> Any was expected
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (135, 88): Type mismatch: inferred type is KFunction1<FieldDataStats, Long> but (FieldDataStats?) -> Any was expected
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (136, 76): Type mismatch: inferred type is KFunction1<FlushStats, Long> but (FlushStats?) -> Any was expected
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (137, 80): Type mismatch: inferred type is KFunction1<FlushStats, TimeValue!> but (FlushStats?) -> Any was expected
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (138, 74): Type mismatch: inferred type is KFunction1<GetStats, Long> but (GetStats?) -> Any was expected
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (139, 71): Type mismatch: inferred type is KFunction1<GetStats, TimeValue!> but (GetStats?) -> Any was expected
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (140, 72): Type mismatch: inferred type is KFunction1<GetStats, Long> but (GetStats?) -> Any was expected
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (141, 77): Type mismatch: inferred type is KFunction1<GetStats, TimeValue!> but (GetStats?) -> Any was expected
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (142, 78): Type mismatch: inferred type is KFunction1<GetStats, Long> but (GetStats?) -> Any was expected
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (143, 78): Type mismatch: inferred type is KFunction1<GetStats, TimeValue!> but (GetStats?) -> Any was expected
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (144, 79): Type mismatch: inferred type is KFunction1<GetStats, Long> but (GetStats?) -> Any was expected
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (145, 92): Unsafe use of a nullable receiver of type IndexingStats?
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (146, 89): Unsafe use of a nullable receiver of type IndexingStats?
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (147, 90): Unsafe use of a nullable receiver of type IndexingStats?
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (148, 91): Unsafe use of a nullable receiver of type IndexingStats?
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (149, 88): Unsafe use of a nullable receiver of type IndexingStats?
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (150, 89): Unsafe use of a nullable receiver of type IndexingStats?
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (151, 90): Unsafe use of a nullable receiver of type IndexingStats?
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (152, 79): Type mismatch: inferred type is KFunction1<MergeStats, Long> but (MergeStats?) -> Any was expected
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (153, 83): Type mismatch: inferred type is KFunction1<MergeStats, Long> but (MergeStats?) -> Any was expected
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (154, 83): Type mismatch: inferred type is KFunction1<MergeStats, ByteSizeValue!> but (MergeStats?) -> Any was expected
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (155, 77): Type mismatch: inferred type is KFunction1<MergeStats, Long> but (MergeStats?) -> Any was expected
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (156, 81): Type mismatch: inferred type is KFunction1<MergeStats, Long> but (MergeStats?) -> Any was expected
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (157, 81): Type mismatch: inferred type is KFunction1<MergeStats, ByteSizeValue!> but (MergeStats?) -> Any was expected
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (158, 81): Type mismatch: inferred type is KFunction1<MergeStats, TimeValue!> but (MergeStats?) -> Any was expected
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (159, 87): Type mismatch: inferred type is KFunction1<QueryCacheStats, ByteSizeValue!> but (QueryCacheStats?) -> Any was expected
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (160, 90): Type mismatch: inferred type is KFunction1<QueryCacheStats, Long> but (QueryCacheStats?) -> Any was expected
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (162, 80): Type mismatch: inferred type is KFunction1<RefreshStats, Long> but (RefreshStats?) -> Any was expected
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (163, 79): Type mismatch: inferred type is KFunction1<RefreshStats, TimeValue!> but (RefreshStats?) -> Any was expected
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (164, 87): Unsafe use of a nullable receiver of type SearchStats?
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (165, 84): Unsafe use of a nullable receiver of type SearchStats?
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (166, 85): Unsafe use of a nullable receiver of type SearchStats?
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (167, 85): Type mismatch: inferred type is KFunction1<SearchStats, Long> but (SearchStats?) -> Any was expected
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (168, 87): Unsafe use of a nullable receiver of type SearchStats?
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (169, 84): Unsafe use of a nullable receiver of type SearchStats?
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (170, 85): Unsafe use of a nullable receiver of type SearchStats?
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (171, 88): Unsafe use of a nullable receiver of type SearchStats?
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (172, 85): Unsafe use of a nullable receiver of type SearchStats?
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (173, 86): Unsafe use of a nullable receiver of type SearchStats?
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (174, 82): Type mismatch: inferred type is KFunction1<SegmentsStats, Long> but (SegmentsStats?) -> Any was expected
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (175, 83): Type mismatch: inferred type is KFunction1<SegmentsStats, ByteSizeValue!> but (SegmentsStats?) -> Any was expected
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (175, 98): 'getZeroMemory(): ByteSizeValue!' is deprecated. Deprecated in Java
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (176, 94): Type mismatch: inferred type is KFunction1<SegmentsStats, ByteSizeValue!> but (SegmentsStats?) -> Any was expected
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (177, 93): Type mismatch: inferred type is KFunction1<SegmentsStats, ByteSizeValue!> but (SegmentsStats?) -> Any was expected
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (178, 86): Type mismatch: inferred type is KFunction1<SegmentsStats, ByteSizeValue!> but (SegmentsStats?) -> Any was expected
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (179, 85): Type mismatch: inferred type is KFunction1<SeqNoStats, Long> but (SeqNoStats?) -> Any was expected
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (180, 84): Type mismatch: inferred type is KFunction1<SeqNoStats, Long> but (SeqNoStats?) -> Any was expected
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (181, 77): Type mismatch: inferred type is KFunction1<SeqNoStats, Long> but (SeqNoStats?) -> Any was expected
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (210, 59): Unsafe use of a nullable receiver of type UnassignedInfo?
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (212, 40): Unsafe use of a nullable receiver of type UnassignedInfo?
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (214, 92): Unsafe use of a nullable receiver of type UnassignedInfo?
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (215, 41): Unsafe use of a nullable receiver of type UnassignedInfo?
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt: (221, 42): Unsafe use of a nullable receiver of type RecoverySource?
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/util/destinationmigration/DestinationMigrationCoordinator.kt: (77, 45): 'getter for isLocalNodeElectedMaster: Boolean' is deprecated. Deprecated in Java
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/main/kotlin/org/opensearch/alerting/workflow/CompositeWorkflowRunner.kt: (145, 17): Condition 'delegateRunResult != null' is always 'true'

> Task :alerting:compileJava
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

> Task :alerting:compileTestKotlin
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/AlertingRestTestCase.kt: (573, 52): Unchecked cast: Any? to Map<String, Any>
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/AlertingRestTestCase.kt: (590, 53): Unchecked cast: Any? to Map<String, Any>
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/DocumentMonitorRunnerIT.kt: (188, 13): Variable 'testDoc' is never used
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/DocumentMonitorRunnerIT.kt: (523, 13): Variable 'searchResult' is never used
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/DocumentMonitorRunnerIT.kt: (562, 13): Variable 'searchResult' is never used
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/DocumentMonitorRunnerIT.kt: (615, 13): Variable 'searchResult' is never used
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/DocumentMonitorRunnerIT.kt: (676, 13): Variable 'searchResult' is never used
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/DocumentMonitorRunnerIT.kt: (697, 13): Variable 'testDoc' is never used
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/MonitorDataSourcesIT.kt: (72, 8): This class shouldn't be used in Kotlin. Use kotlin.collections.Map or kotlin.collections.MutableMap instead.
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/MonitorDataSourcesIT.kt: (340, 9): The value 'executeMonitor(monitor, id, false)' assigned to 'var executeMonitorResponse: ExecuteMonitorResponse? defined in org.opensearch.alerting.MonitorDataSourcesIT.`test execute monitor without triggers`' is never used
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/MonitorDataSourcesIT.kt: (407, 13): Variable 'mappingsResp' is never used
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/MonitorDataSourcesIT.kt: (996, 38): Variable 'executeMonitorResponse' initializer is redundant
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/MonitorDataSourcesIT.kt: (1085, 13): Variable 'clusterStateResponse' is never used
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/MonitorDataSourcesIT.kt: (1413, 13): Condition 'updateMonitorResponse != null' is always 'true'
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/MonitorDataSourcesIT.kt: (1414, 13): The value 'executeMonitor(updateMonitorResponse.monitor, monitorId, false)' assigned to 'var executeMonitorResponse: ExecuteMonitorResponse? defined in org.opensearch.alerting.MonitorDataSourcesIT.`test execute pre-existing monitor and update`' is never used
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/MonitorDataSourcesIT.kt: (1953, 27): Condition 'alerts != null' is always 'true'
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/MonitorDataSourcesIT.kt: (1971, 27): Condition 'alerts != null' is always 'true'
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/MonitorDataSourcesIT.kt: (1979, 27): Condition 'alerts != null' is always 'true'
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/MonitorDataSourcesIT.kt: (2072, 27): Condition 'alerts != null' is always 'true'
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/MonitorDataSourcesIT.kt: (2088, 27): Condition 'alerts != null' is always 'true'
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/MonitorDataSourcesIT.kt: (2096, 27): Condition 'alerts != null' is always 'true'
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/MonitorDataSourcesIT.kt: (2140, 36): Unnecessary safe call on a non-null receiver of type IndexMonitorResponse?. This expression will have nullable type in future releases
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/MonitorDataSourcesIT.kt: (2178, 9): The value 'monitorResponse!!.monitor' assigned to 'var monitor: Monitor defined in org.opensearch.alerting.MonitorDataSourcesIT.`test queryIndex gets increased max fields in mappings`' is never used
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/MonitorDataSourcesIT.kt: (2223, 31): Condition 'alerts != null' is always 'true'
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/ODFERestTestCase.kt: (115, 18): 'OPENSEARCH_SECURITY_SSL_HTTP_KEYSTORE_PASSWORD: String' is deprecated. Deprecated in Java
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/ODFERestTestCase.kt: (116, 18): 'OPENSEARCH_SECURITY_SSL_HTTP_KEYSTORE_KEYPASSWORD: String' is deprecated. Deprecated in Java
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/aggregation/bucketselectorext/BucketSelectorExtAggregatorTests.kt: (105, 17): 'assertThat(T!, Matcher<in T!>!): Unit' is deprecated. Deprecated in Java
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/aggregation/bucketselectorext/BucketSelectorExtAggregatorTests.kt: (165, 17): 'assertThat(T!, Matcher<in T!>!): Unit' is deprecated. Deprecated in Java
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/aggregation/bucketselectorext/BucketSelectorExtAggregatorTests.kt: (186, 17): 'assertThat(T!, Matcher<in T!>!): Unit' is deprecated. Deprecated in Java
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/aggregation/bucketselectorext/BucketSelectorExtAggregatorTests.kt: (229, 17): 'assertThat(T!, Matcher<in T!>!): Unit' is deprecated. Deprecated in Java
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/aggregation/bucketselectorext/BucketSelectorExtAggregatorTests.kt: (273, 17): 'assertThat(T!, Matcher<in T!>!): Unit' is deprecated. Deprecated in Java
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/aggregation/bucketselectorext/BucketSelectorExtAggregatorTests.kt: (321, 17): 'assertThat(T!, Matcher<in T!>!): Unit' is deprecated. Deprecated in Java
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/resthandler/MonitorRestApiIT.kt: (833, 13): Variable 'alert' is never used
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/resthandler/MonitorRestApiIT.kt: (916, 17): Name shadowed: alerts
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/resthandler/SecureWorkflowRestApiIT.kt: (1101, 75): Unnecessary safe call on a non-null receiver of type Response. This expression will have nullable type in future releases
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/resthandler/SecureWorkflowRestApiIT.kt: (1204, 89): Unnecessary safe call on a non-null receiver of type Response. This expression will have nullable type in future releases
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/resthandler/SecureWorkflowRestApiIT.kt: (1400, 73): Unnecessary non-null assertion (!!) on a non-null receiver of type Monitor
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/transport/AlertingSingleNodeTestCase.kt: (91, 9): The expression is unused
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/transport/AlertingSingleNodeTestCase.kt: (196, 13): Variable 'foundAlias' is never used
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/transport/AlertingSingleNodeTestCase.kt: (207, 13): Variable 'foundAlias' is never used
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatIndicesWrappersIT.kt: (39, 9): 'assertEquals(Array<(out) Any!>!, Array<(out) Any!>!): Unit' is deprecated. Deprecated in Java
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatIndicesWrappersIT.kt: (40, 9): 'assertEquals(Array<(out) Any!>!, Array<(out) Any!>!): Unit' is deprecated. Deprecated in Java
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatIndicesWrappersIT.kt: (53, 9): 'assertEquals(Array<(out) Any!>!, Array<(out) Any!>!): Unit' is deprecated. Deprecated in Java
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatIndicesWrappersIT.kt: (54, 9): 'assertEquals(Array<(out) Any!>!, Array<(out) Any!>!): Unit' is deprecated. Deprecated in Java
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatIndicesWrappersIT.kt: (67, 9): 'assertEquals(Array<(out) Any!>!, Array<(out) Any!>!): Unit' is deprecated. Deprecated in Java
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatIndicesWrappersIT.kt: (68, 9): 'assertEquals(Array<(out) Any!>!, Array<(out) Any!>!): Unit' is deprecated. Deprecated in Java
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatIndicesWrappersIT.kt: (109, 49): Unchecked cast: Any? to List<kotlin.collections.HashMap<String, String> /* = java.util.HashMap<String, String> */>
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatIndicesWrappersIT.kt: (152, 49): Unchecked cast: Any? to List<kotlin.collections.HashMap<String, String> /* = java.util.HashMap<String, String> */>
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsWrappersIT.kt: (36, 9): 'assertEquals(Array<(out) Any!>!, Array<(out) Any!>!): Unit' is deprecated. Deprecated in Java
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsWrappersIT.kt: (48, 9): 'assertEquals(Array<(out) Any!>!, Array<(out) Any!>!): Unit' is deprecated. Deprecated in Java
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsWrappersIT.kt: (60, 9): 'assertEquals(Array<(out) Any!>!, Array<(out) Any!>!): Unit' is deprecated. Deprecated in Java
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsWrappersIT.kt: (101, 49): Unchecked cast: Any? to List<kotlin.collections.HashMap<String, String> /* = java.util.HashMap<String, String> */>
w: /Volumes/workplace/OpenSearchAlerting/alerting/src/test/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsWrappersIT.kt: (144, 49): Unchecked cast: Any? to List<kotlin.collections.HashMap<String, String> /* = java.util.HashMap<String, String> */>

> Task :alerting:integTest
Picked up JAVA_TOOL_OPTIONS: -Dlog4j2.formatMsgNoLookups=true

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/8.1.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD SUCCESSFUL in 2m 11s
16 actionable tasks: 16 executed

Comment on lines +40 to +50
var clusterHealthRequest: ClusterHealthRequest =
ClusterHealthRequest().indicesOptions(IndicesOptions.lenientExpandHidden())
var clusterStateRequest: ClusterStateRequest =
ClusterStateRequest().indicesOptions(IndicesOptions.lenientExpandHidden())
var indexSettingsRequest: GetSettingsRequest =
GetSettingsRequest()
.indicesOptions(IndicesOptions.lenientExpandHidden())
.names(IndexSettings.INDEX_SEARCH_THROTTLED.key)
var indicesStatsRequest: IndicesStatsRequest =
IndicesStatsRequest().all().indicesOptions(IndicesOptions.lenientExpandHidden())
var indicesList = arrayOf<String>()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a comment on why we are calling multiple APIs for future ref

Comment on lines +19 to +78
fun `test CatIndicesRequestWrapper validate valid pathParams`() {
// GIVEN
val pathParams = "index1,index-name-2,index-3"

// WHEN
val requestWrapper = CatIndicesRequestWrapper(pathParams = pathParams)

// THEN
assertEquals(3, requestWrapper.clusterHealthRequest.indices().size)
assertEquals(3, requestWrapper.clusterStateRequest.indices().size)
assertEquals(3, requestWrapper.indexSettingsRequest.indices().size)
assertEquals(3, requestWrapper.indicesStatsRequest.indices().size)
}

fun `test CatIndicesRequestWrapper validate without providing pathParams`() {
// GIVEN & WHEN
val requestWrapper = CatIndicesRequestWrapper()

// THEN
assertNull(requestWrapper.clusterHealthRequest.indices())
assertEquals(Strings.EMPTY_ARRAY, requestWrapper.clusterStateRequest.indices())
assertEquals(Strings.EMPTY_ARRAY, requestWrapper.indexSettingsRequest.indices())
assertNull(requestWrapper.indicesStatsRequest.indices())
}

fun `test CatIndicesRequestWrapper validate blank pathParams`() {
// GIVEN
val pathParams = " "

// WHEN
val requestWrapper = CatIndicesRequestWrapper(pathParams = pathParams)

// THEN
assertNull(requestWrapper.clusterHealthRequest.indices())
assertEquals(Strings.EMPTY_ARRAY, requestWrapper.clusterStateRequest.indices())
assertEquals(Strings.EMPTY_ARRAY, requestWrapper.indexSettingsRequest.indices())
assertNull(requestWrapper.indicesStatsRequest.indices())
}

fun `test CatIndicesRequestWrapper validate empty pathParams`() {
// GIVEN
val pathParams = ""

// WHEN
val requestWrapper = CatIndicesRequestWrapper(pathParams = pathParams)

// THEN
assertNull(requestWrapper.clusterHealthRequest.indices())
assertEquals(Strings.EMPTY_ARRAY, requestWrapper.clusterStateRequest.indices())
assertEquals(Strings.EMPTY_ARRAY, requestWrapper.indexSettingsRequest.indices())
assertNull(requestWrapper.indicesStatsRequest.indices())
}

fun `test CatIndicesRequestWrapper validate invalid pathParams`() {
// GIVEN
val pathParams = "_index1,index^2"

// WHEN & THEN
assertThrows(IllegalArgumentException::class.java) { CatIndicesRequestWrapper(pathParams = pathParams) }
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move to a unit test class

Comment on lines +114 to +126
testIndices.forEach { (indexName, docCount) ->
if (pathParamsIndices.contains(indexName)) {
assertEquals(
indexName,
returnedIndices[indexName]?.get(CatIndicesResponseWrapper.IndexInfo.INDEX_FIELD) as String
)
assertEquals(
docCount.toString(),
returnedIndices[indexName]?.get(CatIndicesResponseWrapper.IndexInfo.DOCS_COUNT_FIELD) as String
)
}
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Future follow up to have a real cat indices call and compare all the values and not some.

assertThrows(IllegalArgumentException::class.java) { CatIndicesRequestWrapper(pathParams = pathParams) }
}

suspend fun `test CatIndicesResponseWrapper returns with only indices in pathParams`() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets add an alias test too

Comment on lines +19 to +70
fun `test CatShardsRequestWrapper validate valid pathParams`() {
// GIVEN
val pathParams = "index1,index_2,index-3"

// WHEN
val requestWrapper = CatShardsRequestWrapper(pathParams = pathParams)

// THEN
assertEquals(3, requestWrapper.clusterStateRequest.indices().size)
assertEquals(3, requestWrapper.indicesStatsRequest.indices().size)
}

fun `test CatShardsRequestWrapper validate without providing pathParams`() {
// GIVEN & WHEN
val requestWrapper = CatShardsRequestWrapper()

// THEN
assertEquals(Strings.EMPTY_ARRAY, requestWrapper.clusterStateRequest.indices())
assertNull(requestWrapper.indicesStatsRequest.indices())
}

fun `test CatShardsRequestWrapper validate blank pathParams`() {
// GIVEN
val pathParams = " "

// WHEN
val requestWrapper = CatShardsRequestWrapper(pathParams = pathParams)

// THEN
assertEquals(Strings.EMPTY_ARRAY, requestWrapper.clusterStateRequest.indices())
assertNull(requestWrapper.indicesStatsRequest.indices())
}

fun `test CatShardsRequestWrapper validate empty pathParams`() {
// GIVEN
val pathParams = ""

// WHEN
val requestWrapper = CatShardsRequestWrapper(pathParams = pathParams)

// THEN
assertEquals(Strings.EMPTY_ARRAY, requestWrapper.clusterStateRequest.indices())
assertNull(requestWrapper.indicesStatsRequest.indices())
}

fun `test CatShardsRequestWrapper validate invalid pathParams`() {
// GIVEN
val pathParams = "_index1,index^2"

// WHEN & THEN
assertThrows(IllegalArgumentException::class.java) { CatShardsRequestWrapper(pathParams = pathParams) }
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move to unit test class

Comment on lines +105 to +118
assertEquals(pathParamsIndices.size, returnedIndices.keys.size)
testIndices.forEach { (indexName, docCount) ->
if (pathParamsIndices.contains(indexName)) {
assertEquals(
indexName,
returnedIndices[indexName]?.get(CatShardsResponseWrapper.ShardInfo.INDEX_FIELD) as String
)
assertEquals(
docCount.toString(),
returnedIndices[indexName]?.get(CatShardsResponseWrapper.ShardInfo.DOCS_FIELD) as String
)
}
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Future follow up to compare against real cat shards call on all values.

@AWSHurneyt
Copy link
Collaborator Author

Created this issue to track these follow-up items.
#1006

@AWSHurneyt AWSHurneyt merged commit a772019 into opensearch-project:main Jul 12, 2023
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.x failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.x 2.x
# Navigate to the new working tree
cd .worktrees/backport-2.x
# Create a new branch
git switch --create backport/backport-992-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 a7720199d95ffb071c988786afb978172586e834
# Push it to GitHub
git push --set-upstream origin backport/backport-992-to-2.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.x

Then, create a pull request where the base branch is 2.x and the compare/head branch is backport/backport-992-to-2.x.

@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.9 failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.9 2.9
# Navigate to the new working tree
cd .worktrees/backport-2.9
# Create a new branch
git switch --create backport/backport-992-to-2.9
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 a7720199d95ffb071c988786afb978172586e834
# Push it to GitHub
git push --set-upstream origin backport/backport-992-to-2.9
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.9

Then, create a pull request where the base branch is 2.9 and the compare/head branch is backport/backport-992-to-2.9.

AWSHurneyt added a commit to AWSHurneyt/OpenSearch-Alerting that referenced this pull request Jul 12, 2023
… cat/indices, and cat/shards. (opensearch-project#992)

* Implemented support for configuring a cluster metrics monitor to call cat/indices, and cat/shards.

Signed-off-by: AWSHurneyt <[email protected]>

* Fixed ktlint errors.

Signed-off-by: AWSHurneyt <[email protected]>

* Refactored executeTransportAction to use suspendUntil() instead of get() to receive responses.

Signed-off-by: AWSHurneyt <[email protected]>

---------

Signed-off-by: AWSHurneyt <[email protected]>
AWSHurneyt added a commit to AWSHurneyt/OpenSearch-Alerting that referenced this pull request Jul 12, 2023
… cat/indices, and cat/shards. (opensearch-project#992)

* Implemented support for configuring a cluster metrics monitor to call cat/indices, and cat/shards.

Signed-off-by: AWSHurneyt <[email protected]>

* Fixed ktlint errors.

Signed-off-by: AWSHurneyt <[email protected]>

* Refactored executeTransportAction to use suspendUntil() instead of get() to receive responses.

Signed-off-by: AWSHurneyt <[email protected]>

---------

Signed-off-by: AWSHurneyt <[email protected]>
AWSHurneyt added a commit that referenced this pull request Jul 12, 2023
…monitor to call cat/indices, and cat/shards. #992 (#1009)

* Implemented support for configuring a cluster metrics monitor to call cat/indices, and cat/shards. (#992)

* Implemented support for configuring a cluster metrics monitor to call cat/indices, and cat/shards.

Signed-off-by: AWSHurneyt <[email protected]>

* Fixed ktlint errors.

Signed-off-by: AWSHurneyt <[email protected]>

* Refactored executeTransportAction to use suspendUntil() instead of get() to receive responses.

Signed-off-by: AWSHurneyt <[email protected]>

---------

Signed-off-by: AWSHurneyt <[email protected]>

* Resolved merge conflicts.

Signed-off-by: AWSHurneyt <[email protected]>

* Fixed ktlint errors.

Signed-off-by: AWSHurneyt <[email protected]>

* Refactored API calls from suspendUntil() to get().

Signed-off-by: AWSHurneyt <[email protected]>

---------

Signed-off-by: AWSHurneyt <[email protected]>
opensearch-trigger-bot bot pushed a commit that referenced this pull request Jul 12, 2023
…monitor to call cat/indices, and cat/shards. #992 (#1009)

* Implemented support for configuring a cluster metrics monitor to call cat/indices, and cat/shards. (#992)

* Implemented support for configuring a cluster metrics monitor to call cat/indices, and cat/shards.

Signed-off-by: AWSHurneyt <[email protected]>

* Fixed ktlint errors.

Signed-off-by: AWSHurneyt <[email protected]>

* Refactored executeTransportAction to use suspendUntil() instead of get() to receive responses.

Signed-off-by: AWSHurneyt <[email protected]>

---------

Signed-off-by: AWSHurneyt <[email protected]>

* Resolved merge conflicts.

Signed-off-by: AWSHurneyt <[email protected]>

* Fixed ktlint errors.

Signed-off-by: AWSHurneyt <[email protected]>

* Refactored API calls from suspendUntil() to get().

Signed-off-by: AWSHurneyt <[email protected]>

---------

Signed-off-by: AWSHurneyt <[email protected]>
(cherry picked from commit 84e8b00)
AWSHurneyt added a commit that referenced this pull request Jul 12, 2023
…monitor to call cat/indices, and cat/shards. #992 (#1009) (#1011)

* Implemented support for configuring a cluster metrics monitor to call cat/indices, and cat/shards. (#992)

* Implemented support for configuring a cluster metrics monitor to call cat/indices, and cat/shards.

Signed-off-by: AWSHurneyt <[email protected]>

* Fixed ktlint errors.

Signed-off-by: AWSHurneyt <[email protected]>

* Refactored executeTransportAction to use suspendUntil() instead of get() to receive responses.

Signed-off-by: AWSHurneyt <[email protected]>

---------

Signed-off-by: AWSHurneyt <[email protected]>

* Resolved merge conflicts.

Signed-off-by: AWSHurneyt <[email protected]>

* Fixed ktlint errors.

Signed-off-by: AWSHurneyt <[email protected]>

* Refactored API calls from suspendUntil() to get().

Signed-off-by: AWSHurneyt <[email protected]>

---------

Signed-off-by: AWSHurneyt <[email protected]>
(cherry picked from commit 84e8b00)

Co-authored-by: AWSHurneyt <[email protected]>
AWSHurneyt added a commit to AWSHurneyt/OpenSearch-Alerting that referenced this pull request Jul 12, 2023
… cat/indices, and cat/shards. (opensearch-project#992)

* Implemented support for configuring a cluster metrics monitor to call cat/indices, and cat/shards.

Signed-off-by: AWSHurneyt <[email protected]>

* Fixed ktlint errors.

Signed-off-by: AWSHurneyt <[email protected]>

* Refactored executeTransportAction to use suspendUntil() instead of get() to receive responses.

Signed-off-by: AWSHurneyt <[email protected]>

---------

Signed-off-by: AWSHurneyt <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x backport 2.9 backports PRs to 2.9
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants